{% extends "swaps/base.html" %}

{% load i18n %}
{% load humanize %}
{% load pagination_tags %}
{% load tagging_tags %}
{% load wiki %}
{% load markup %}
{% load restructuredtext %}
{% load threadedcommentstags %}
{% load shorttimesince_tag %}

{% block head_title %}{% blocktrans %}Swaps proposed to you{% endblocktrans %}{% endblock %}

{% block body %}
    <h1>{% trans "Swaps proposed to you" %}</h1>
    
    
    {% if swaps %}

        
        {% autopaginate swaps %}

			<table class="tasks" >
				<tr>
					<th>Proposal Time</th>
					<th>Proposing Offer</th>
					<th>Offered By</th>
					<th>Your Offer</th>
					<th>State</th>
				</tr>
				{% for swap in swaps %}
					<tr class="{% cycle odd,even %}">
						<td><a href="{{ swap.get_absolute_url }}">{{ swap.proposed_time|shorttimesince }}</a></td>
						<td>{{ swap.proposing_offer }}</td>
						<td>{{ swap.proposing_offer.offerer }}</td>
						<td>{{ swap.responding_offer }}</td>
						<td>{{ swap.get_state_display }}</td>
						<td>
							<form style="display: inline;" action="{% url accept_swap swap.id %}" method="POST">
								<input type="submit" value="{% trans "Accept" %}" />
							</form>
							<form style="display: inline;" action="{% url reject_swap swap.id %}" method="POST">
								<input type="submit" value="{% trans "Reject" %}" />
							</form>
						</td>
					</tr>
				{% endfor %}
			</table>

        {% paginate %}

    {% else %}
        No proposed swaps.
    {% endif %}
    
{% endblock %}